Tootsville::Check-Alexa-Signature-Cert-Chain-Url

Function

Check-Alexa-Signature-Cert-Chain-Url names a function, with lambda list (URL):

Perform the mandatory checks on an Alexa request's certificate chain URL.

Excerpt from Amazon requirements at https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-a-web-service.html:

Verifying the Signature Certificate URL

Before downloading the certificate from the URL specified in the SignatureCertChainUrl header, you should ensure that the URL represents a URL Amazon would use for the certificate. This protects against requests that attempt to make your web service download malicious files and similar attacks.

First, normalize the URL so that you can validate against a correctly formatted URL. For example, normalize

https://s3.amazonaws.com/echo.api/../echo.api/echo-api-cert.pem

to:

https://s3.amazonaws.com/echo.api/echo-api-cert.pem

Next, determine whether the URL meets each of the following criteria:

Examples of correctly formatted URLs:

Examples of invalid URLs:

If the URL does not pass these tests, reject the request and do not proceed with verifying the signature.

File

Defined in file src/endpoints/gossip/alexa/alexa.lisp.